home *** CD-ROM | disk | FTP | other *** search
/ Practical Algorithms for Image Analysis / Practical Algorithms for Image Analysis.iso / TARFILE.GZ / tarfile / libimage / draw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-11  |  2.9 KB  |  74 lines

  1. /* 
  2.  * draw.h
  3.  * 
  4.  * Practical Algorithms for Image Analysis
  5.  * 
  6.  * Copyright (c) 1999 SOS Software
  7.  */
  8.  
  9. #ifndef _DRAW_H_
  10. #define    _DRAW_H_
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <math.h>
  16. #include "tiffimage.h"
  17. #include "gd.h"
  18. #include "misc.h"
  19.  
  20. /*
  21.  *   Function prototypes     for Draw.c
  22.  */
  23. void setpixel (int x, int y, Image * imgIO, int value);
  24. unsigned char getpixel (int x, int y, Image * imgIO);
  25. void getrow (unsigned char *row_p, int row, Image * imgIO);
  26. void draw_border (int jmin, int imin, int jmax, int imax, Image * imgIO, int value);
  27. void zero_border (Image * imgIO, int pix);
  28. void reset_image (Image * imgIO, int value);
  29. void draw_line (int x1, int y1, int x2, int y2, Image * imgIO, int value);
  30. void draw_circle (int xC, int yC, int R, Image * imgIO, int value);
  31. void draw_filled_circle (int xC, int yC, int R, Image * imgIO, int value);
  32. void gdImageChar (gdFontPtr f, int x, int y, int c, Image * imgIO, int value);
  33. void gdImageCharUp (gdFontPtr f, int x, int y, char c, Image * imgIO, int value);
  34. void gdImageString (gdFontPtr f, int x, int y, char *s, Image * imgIO, int value);
  35. void gdImageStringUp (gdFontPtr f, int x, int y, char *s, Image * imgIO, int value);
  36. void draw_ellipse (int cx, int cy, int w, int h, Image * imgIO, int value);
  37. void fill_Voronoi (double x, double y, int n, Image * imgIO, int mode);
  38. long gdImageFill (int x, int y, Image * imgIO, int value);
  39. long gdImageFillToBorder (int x, int y, int border, Image * imgIO, int value);
  40. void draw_cross (int x, int y, int size, Image * imgIO, int value);
  41. void draw_poly (int *X, int *Y, int n, Image * imgIO, int value);
  42. unsigned long draw_polyfill (int *X, int *Y, int n, Image * imgIO, int value);
  43. void draw_square (int x, int y, int size, Image * imgIO, int value);
  44. void draw_rect (int x1, int y1, int x2, int y2, Image * imgIO, int value);
  45. void draw_up_triang (int x, int y, int offset, Image * imgIO, int value);
  46. void draw_dn_triang (int x, int y, int offset, Image * imgIO, int value);
  47. void draw_horline (int xmin, int xmax, int y, Image * imgIO, int value);
  48. void draw_verline (int x, int ymin, int ymax, Image * imgIO, int value);
  49. void draw_poly_ovl (int *x, int *y, int n,
  50.                     int xc, int yc,
  51.                     double av_dirn, int polytype,
  52.                     Image * imgIO, int value);
  53. void draw_normal (int x, int y, double m, Image * imgIO, int value);
  54.  
  55. /*
  56.  *   Some convenient definitions
  57.  */
  58. #define PIX_RANGE       256
  59. #define WHITE        255
  60. #define BLACK        0
  61. #define GRAY        128
  62. #define    APOLY        0
  63. #define    HULLPOLY    1
  64.  
  65. #define DISC_ONLY       1       /* label modes for fill_Voronoi */
  66. #define HEXA_ONLY       2
  67.  
  68. #define HEIGHT        512             /*default y allocation of graphics buffer */
  69. #define WIDTH        512              /*default x allocation of graphics buffer */
  70. #define BPS            8                 /*default bits per sample for graphics buffer */
  71.         /*(set=1 for binary image) */
  72.  
  73. #endif /* _DRAW_H_ */
  74.